﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="QuanTriImage.aspx.cs" Inherits="QuangMobile.Admin.QuanTriImage"
    MasterPageFile="~/Admin/AdminSite.Master" %>

<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
    <div class="NoiDungChinh">
        <img class="FormImage" src="images/computer.png" />
        <p class="FormTitle">
            Quản trị chuyên mục Phóng sự ảnh</p>
    </div>
    <div class="NoiDung">
        <div id="ThemMoiBaiViet" runat="server" visible="false">
            <table>
                <tr>
                    <td>
                        Tiêu đề bài viết
                    </td>
                    <td>
                        <asp:TextBox ID="txtTieuDe" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="center">
                        <asp:Button ID="btnLuu" runat="server" Text="Lưu lại" CssClass="cmdBtn" OnClick="btnLuu_Click" />
                        <asp:Button ID="btnHuy" runat="server" Text="Hủy" CssClass="cmdBtn" OnClick="btnHuy_Click" />
                    </td>
                </tr>
            </table>
        </div>
        <asp:Button ID="btnThem" runat="server" Text="Thêm mới bài viết Phóng sự ảnh" CssClass="cmdBtn"
            OnClick="btnThem_Click" />
        <asp:GridView ID="grvData" runat="server" AutoGenerateColumns="False" CssClass="ListTable"
            OnRowCommand="grvData_RowCommand" OnRowCancelingEdit="grvData_RowCancelingEdit"
            OnRowEditing="grvData_RowEditing">
            <Columns>
                <asp:BoundField HeaderText="Tiêu đề bài viết" DataField="TieuDe" ReadOnly="true" />
                <asp:TemplateField HeaderText="Trạng thái phê duyệt">
                    <EditItemTemplate>
                        <asp:RadioButton ID="rbtPheDuyet" runat="server" Text="Đã Phê duyệt" GroupName="PheDuyet"
                            Checked='<%# Eval("IsPheDuyet").ToString().Equals("False") ? false : true %>' /><br />
                        <asp:RadioButton ID="rbtChoPheDuyet" runat="server" Text="Chưa phê duyệt" GroupName="PheDuyet"
                            Checked='<%# Eval("IsPheDuyet").ToString().Equals("False") ? true : false %>' />
                    </EditItemTemplate>
                    <ItemTemplate>
                        <%#Eval("IsPheDuyet").ToString().Equals("True") ? "<b><font color=#445D00>Đã phê duyệt</font></b>" : "<b><font color=#CA5900>Chờ phê duyệt</font></b>"%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Phê duyệt">
                    <ItemStyle Wrap="False" Width="60px" HorizontalAlign="Center"></ItemStyle>
                    <ItemTemplate>
                        <asp:ImageButton ID="imgPheDuyet" runat="server" ImageUrl="../images/061.png" ToolTip="Phe Duyệt"
                            CommandArgument='<%# Eval("ID")%>' CommandName="Edit"></asp:ImageButton>
                    </ItemTemplate>
                    <ItemStyle Width="70px"></ItemStyle>
                    <EditItemTemplate>
                        <asp:ImageButton ID="imgUpdate" runat="server" ImageUrl="../images/approval.png"
                            ToolTip="Cập nhật" CommandArgument='<%# Eval("ID")%>' CommandName="<%# QuangMobile.MyConst.Action.Approve %>">
                        </asp:ImageButton>
                        <asp:ImageButton ID="imgCancel" runat="server" CommandName="Cancel" ImageUrl="../images/cancel.png"
                            CommandArgument='<%# Eval("ID") %>' />
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Sửa tiêu đề">
                    <HeaderStyle Wrap="False"></HeaderStyle>
                    <ItemStyle Wrap="False" Width="60px" HorizontalAlign="Center"></ItemStyle>
                    <ItemTemplate>
                        <asp:ImageButton ID="imgEdit" runat="server" ImageUrl="../images/edit.gif" ToolTip="Sửa"
                            CommandArgument='<%# Eval("ID")%>' CommandName="<%# QuangMobile.MyConst.Action.Update %>">
                        </asp:ImageButton>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Sửa chi tiết tin">
                    <HeaderStyle Wrap="False"></HeaderStyle>
                    <ItemStyle Wrap="False" Width="60px" HorizontalAlign="Center"></ItemStyle>
                    <ItemTemplate>
                        <asp:ImageButton ID="imgEditDetail" runat="server" ImageUrl="../images/editdetail.png"
                            ToolTip="Sửa" CommandArgument='<%# Eval("ID")%>' CommandName="EditDetail"></asp:ImageButton>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Xóa tin">
                    <HeaderStyle Wrap="False"></HeaderStyle>
                    <ItemStyle Wrap="False" Width="60px" HorizontalAlign="Center"></ItemStyle>
                    <ItemTemplate>
                        <asp:ImageButton ID="imgDelete" runat="server" ImageUrl="../images/delete.png" ToolTip="Sửa"
                            CommandArgument='<%# Eval("ID")%>' CommandName="<%# QuangMobile.MyConst.Action.Delete %>"
                            OnClientClick="return confirm('Bạn có chắc là muốn xóa bản ghi này không ?')">
                        </asp:ImageButton>
                    </ItemTemplate>
                    <ItemStyle Width="70px"></ItemStyle>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
    </div>
</asp:Content>
